package com.cgc999.host.base;

import com.cgc999.host.config.ApiConfig;

import java.io.Serializable;

/**
 * 网络请求返回基类
 */
public class BaseResponse implements Serializable {
    private static final long serialVersionUID = 1L;

    private int code;//返回code

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    private String msg; //信息

    public boolean success() {
        return ApiConfig.getSucceedCode() == code;
    }

    public boolean tokenInvalid() {
        return ApiConfig.getInvalidToken() == code;
    }

    public boolean quitApp(){
        return ApiConfig.getQuitCode() == code;
    }

}
